window.onload = function (){
    var errorInfo= getQuery("errorInfo");
    if (errorInfo != null && errorInfo === "noland"){
        $("errorSpan").innerHTML="登录后才可以访问";
    }
}


function login(){
    axios.get("/user/login",{
        params:{
            userName:$("nameTxt").value,
            pwd:$("pwdTxt").value
        }
    }).then(resp =>{
        var info=resp.data;
        if (info == "ok"){
            location.href="../html/menu.html";
        }else {
            $("errorSpan").innerHTML="密码错误或用户名不存在";
        }
    })
}